app.controller('ceping',function($scope,$http,$ionicLoading,$stateParams){
	console.log($stateParams)
	$ionicLoading.show()
	$http.get('/api/v2/articles/'+$stateParams.id).then(function(res){
		if(res){
			$ionicLoading.hide()
		}
//		console.log(res.data)
		$scope.ceping=res.data
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
	$http.get('/api/v2/reports/'+$stateParams.id+'/short').then(function(res){
		if(res){
			$ionicLoading.hide()
		}
		$scope.shorts=res.data
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
	$http.get('/api/v2/articles/'+$stateParams.name).then(function(res){
		if(res){
			$ionicLoading.hide()
		}
//		console.log(res.data)
		$scope.xiangguan=res.data
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
	$http.get('/api/v2/articles/'+$stateParams.id+'/comments',{
		params:{
			"format":"threaded",
			"offset":0,
			"limit":500
		}
	}).then(function(res){
		if(res){
			$ionicLoading.hide()
		}
		console.log(res.data)
		$scope.users=res.data
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
})
.filter('times',function(){
	return function(val){
	  console.log(val)
	  val = val*1000
	  console.log(val)
	  return val
	}
})
